<?php

    #-------------------------------------------------------------#
	# This file is part of the Tekuna MVC Microframework for PHP. #
	# (c) 2009 Niels Jäckel <niels.jaeckel@tekuna.org>            #
	# Please visit http://tekuna.org/ for more information.       #
	#                                                             #
	# This software is licensed under the MIT License. Please     #
	# view the LICENSE file for the full text of this license.    #
    #-------------------------------------------------------------#


	class TranslatorTest extends AbstractTekunaTestCase {

		public function testDefaultTranslator() {

			// get translator instance
			$sLanguageFile = APPLICATION_ROOT . 'testLanguageMappings.ini';
			$objTranslator = new DefaultTranslator('en', $sLanguageFile);

			// test simple translation
			$this -> assertIdentical($objTranslator -> translate('%text.simple%'), 'simple text');

			// test translation with replacement
			$this -> assertIdentical($objTranslator -> translate('%text.advanced|arg1|arg2%'), 'A arg1 B arg2 C');
			$this -> assertIdentical($objTranslator -> translate('%text.advanced.reverse|arg1|arg2%'), 'A arg2 B arg1 C');
		}
	}



